package com.zjj.dao;

import com.zjj.pojo.Class;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface ClassMapper {

    @Select("SELECT * FROM c_class c WHERE class_name = #{className}")
    @Results({
            @Result(property = "className", column = "class_name"),
            @Result(property = "studentList", column = "id", many = @Many(select = "com.zjj.dao.StudentMapper.selectStudentByClassId"))})
    Class selectStudentByClassName(String className);
}
